import { getData, putData } from '../../untils/request';

// 修改头像
export async function updateUserAvatar(data) {
    const result = await putData(`/user/update`, data);
    return result;
}

// 获取点赞文章
export async function getLikesArticle(uuid, page, size) {
    const result = await getData(`/article/getlikes/${uuid}/${page}/${size}`);
    return result;
}

// 统计粉丝量
export async function countFan(concernedId) {
    const result = await getData(`/concerned/countFans/${concernedId}`);
    return result;
}

// 统计关注者
export async function countConcerned(userId) {
    const result = await getData(`/concerned/countConcerneds/${userId}`);
    return result;
}

// 统计用户点赞的文章
export async function countLiked(userId) {
  const result = await getData(`/article/countLikes/${userId}`);
  return result;
}

// 找到自己的文章
export async function findMyArticle(authorId, page, size) {
  const result = await getData(`/article/getArticleByAuthor/${authorId}/${page}/${size}`);
  return result;
}

// 删除文章
export async function deleteArticle(uuid) {
  const result = await putData(`/article/delete/${uuid}`);
  return result;
}

